import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {StarService} from "../star.service";
import {SettingUrl} from "../../../public/setting/setting_url";

@Component({
  selector: 'app-star-record-detail',
  templateUrl: './star-record-detail.component.html',
  styleUrls: ['./star-record-detail.component.css']
})
export class StarRecordDetailComponent implements OnInit {
  private code: string;
  public starRecordInfo: any = {};//starRecord信息

  constructor(private starService: StarService, private route: ActivatedRoute, private router: Router) {
  }

  ngOnInit() {
    this.code = this.route.snapshot.params.code;//获取参数
    this.loadStarRecordInfo();//查询starRecord类型列表
  }

  /**
   * 查询starRecord信息
   */
  loadStarRecordInfo() {
    this.starService.loadStarRecordByCode(this.code).then((data: any) => {
      if (data) this.starRecordInfo = data;
    })
  }

}
